package ru.scf37;

import java.awt.Dimension;
import java.awt.FlowLayout;

import javax.swing.GroupLayout;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JScrollPane;

public class Main {
	
	public static IconListPanelModel createModel() {
		IconListPanelModel model = new IconListPanelModelImpl();
		Icon icon = new ImageIcon("icon.gif");
		for (int i = 0 ; i < 201 ; i++) {
			model.getItems().add(new IconListItemImpl(icon, "item string "+i));
		}
		return model;
	}
	
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		IconListPanel iconListPanel = new IconListPanel();
		iconListPanel.setModel(createModel());
		frame.setSize(640, 480);
		frame.getContentPane().add(new JScrollPane(iconListPanel, JScrollPane.VERTICAL_SCROLLBAR_NEVER, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED));
		frame.setVisible(true);
	}
}
